home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / Bomber Fortress.swf / scripts / DefineSprite_244 / frame_2 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.3 KB  |  66 lines

  1. my_radius = _width / "2";
  2. my_x = _X;
  3. my_y = _Y;
  4. my_n = _name;
  5. if(ymov == "")
  6. {
  7.    ymov = "2";
  8.    xmov = "0";
  9.    ysign = "2";
  10.    xsign = "0";
  11.    xmov *= xsign;
  12.    ymov *= ysign;
  13. }
  14. if(my_radius + eval("/:speed") >= my_x)
  15. {
  16.    gotoAndPlay(1);
  17. }
  18. if(my_radius + eval("/:speed") >= my_y)
  19. {
  20.    gotoAndPlay(1);
  21. }
  22. if(my_x >= eval("/:movie_width") - my_radius - eval("/:speed"))
  23. {
  24.    gotoAndPlay(1);
  25. }
  26. if(my_y >= eval("/:movie_height") - my_radius - eval("/:speed"))
  27. {
  28.    gotoAndPlay(1);
  29. }
  30. n = "1";
  31. while(eval("/:total_circles") >= n)
  32. {
  33.    if(n ne my_n)
  34.    {
  35.       n_x = getProperty("../" add n, _X);
  36.       n_y = getProperty("../" add n, _Y);
  37.       n_radius = getProperty("../" add n, _width) / "2";
  38.       delta_x = my_x + xmov - n_x;
  39.       delta_y = my_y + ymov - n_y;
  40.       if(delta_x * delta_x + delta_y * delta_y < (my_radius + n_radius) * (my_radius + n_radius))
  41.       {
  42.          tellTarget("sub")
  43.          {
  44.             gotoAndPlay(2);
  45.          }
  46.          if(eval("/:soundon") == "1")
  47.          {
  48.             tellTarget("/ratata")
  49.             {
  50.                play();
  51.             }
  52.          }
  53.          if(eval("/:soundon") == "1")
  54.          {
  55.             tellTarget("/uexplode")
  56.             {
  57.                play();
  58.             }
  59.          }
  60.          gotoAndPlay(4);
  61.       }
  62.    }
  63.    n += "1";
  64. }
  65. _Y = my_y + ymov;
  66.